﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using G.Model;
using G.Runtime;

namespace G.Runtime
{
    public abstract class GameCommand : HasGameSpaceDef
    {
        public static readonly List<Type> _Commands = new List<Type>();

        public static List<Type> Commands 
        {
            get { return _Commands; }
        }

        private readonly string _Name;
        private readonly GameSpaceDef _Game;

        public GameCommand(GameSpaceDef pGame, string pName)
        {
            _Game = pGame;
            _Name = pName;
        }

        public GameCommand Copy()
        {
            return (GameCommand)base.MemberwiseClone();
        }

        [Browsable(false)]
        public string Name
        {
            get { return _Name; }
        }

        [Browsable(false)]
        public GameSpaceDef GameDef
        {
            get { return _Game; }
        }

        public abstract void Invoke(GameSpace game);

    }
}
